//
//  main.swift
//  24.内存管理
//
//  Created by 左忠飞 on 2021/8/9.
//

import Foundation

var xiaoming:Person? = Person(name: "小明")
print("created\(xiaoming!)")

var laptop:Asset? = Asset(name: "笔记本", value: 1_500.0)
var hat:Asset? = Asset(name: "帽子", value: 175.0)
var backpack:Asset? = Asset(name: "背包", value: 45.0)

xiaoming?.takeOwnership(of: laptop!)
xiaoming?.takeOwnership(of: hat!)


xiaoming = nil
print("小明 现在是 \(xiaoming)")

laptop = nil
hat = nil
backpack = nil
